<%--
  Created by IntelliJ IDEA.
  User: ZiFeng
  Date: 2022/11/10
  Time: 19:56
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="../common/top.jsp" %>
<link rel="stylesheet" type="text/css" href="css/orderPage.css">
<html>
<head>
    <style>
        .showB{
            text-align: left;

        }
        .userinfo{
            width:300px;
            padding-top: 20px;
            outline: none;
            border: none;
            border-bottom: 3px solid black;
            background-color: rgba(255, 255, 255, 0);
            text-align: center;
        }

    </style>
    <title>确认订单</title>
</head>
<body>
<script></script>
<c:if test="${sessionScope.username == null}">
    <div>
        <h1 style="text-align: center;"><a href="login" onMouseOver="this.style.color='#70B6BF'"
                                           onMouseOut="this.style.color='black'" style="font-size: 100px;"
                                           target="_self">点击去登录</a></h1>
    </div>
</c:if>

<c:if test="${sessionScope.username != null}">
    <div style="text-align: left;position: relative;left: 24%">
        <h2>确认订单：</h2>
    </div>
    <c:if test="${sessionScope.cartItemList.size() != 0}">
        <div class="mainColumnm">
            <div class="wrap clearfix" style="text-align: center;">
                <table width="100%" class="cartTable" cellspacing="0" cellpadding="10px">
                    <!-- 首行 -->
                    <tr class="title">
                        <td width="100">商品信息</td>
                        <td width="100">单价（元）</td>
                        <td width="100">数量</td>
                        <td width="100">金额（元）</td>
                    </tr>


                    <!-- 商品具体信息 -->
                    <c:forEach var="orderItem" items="${sessionScope.orderItemList}">
                        <tr class="row">
                            <td class="tal">
                                <a href="Item?productId=${orderItem.item.productId}&categoryId=${orderItem.item.categoryId}"
                                   class="pic">
                                    <img width="50" height="50"
                                         src="${orderItem.item.description}"
                                         alt="${orderItem.item.name}">
                                </a>
                            </td>
                            <td class="tal"><a
                                    href="Item?productId=${orderItem.item.productId}&categoryId=${orderItem.item.categoryId}">${orderItem.item.name}</a>
                            </td>
                            <td>
                                <div class="amount">
                                    <form name="quantityFrm" action="cartEdit">
                                        <label class="unum">${orderItem.quantity}</label>
                                    </form>
                                </div>
                            </td>
                            <td>
                                <span class="tdl">${orderItem.price}</span>
                                <br>
                                <b class="unit">${orderItem.price}</b>
                            </td>
                        </tr>
                    </c:forEach>
                </table>

                <div id = "${sessionScope.uid}" class="page-wrap w">
                    <div id = "${sessionScope.username}" class="panel">
                        <div class="panel-title">收货地址</div>
                        <div class="panel-body" id = "address-fa">

                            <c:forEach var="location" items="${sessionScope.locationList}">
                                <div class="address-item active">
                                    <div class="address-title">${location.region}</div>
                                    <div class="address-detail">${location.detail}</div>
                                    <div class="address-operator" id="${location.locationId}">
                                        <span class="link-edit">编辑</span>
                                        <span class="link-delete">删除</span>
                                        <span class="link-confirm">确定</span>
                                    </div>
                                </div>
                            </c:forEach>

                            <div id = "add" class="address-item active">
                                <div class="address-add">
                                        <div class = "link-text">使用新地址</div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>

                <div style="margin: 0 auto;display: inline-block;text-align: center;">
                    <p><input type="password" id = "password" placeholder="请输入密码" class="userinfo"></p>
                    <p id = "showMessage" class="showB" style="color: dimgrey">请输入密码以验证安全性</p>
                </div>
                <table width="100%" class="cartTable" cellspacing="0" cellpadding="10px">
                    <tr class="count">
                        <td colspan="7">
                            <div class="jiesuan clearfix">
                                <div class="right fr clearfix">

                                    <p>总价(不含运费、税费)：<span class="red t-price">￥${sessionScope.orderTotalPrice}</span>
                                    </p>
                                    <!-- <div><a href="#" class="btn pay">结算</a></div> -->
                                    <a href="#" class="btn pay fr" id = "Apply">支付订单</a>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>

            </div>
        </div>
    </c:if>
</c:if>



</body>

<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="javascripts/addressOperation.js"></script>
</html>
